Optimal. Leaf size=267 \[ \frac {((5+3 i) A-(3-i) B) \tan ^{-1}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{4 \sqrt {2} a d}+\frac {((3-i) B-(5+3 i) A) \tan ^{-1}\left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{4 \sqrt {2} a d}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}-\frac {\left (\frac {1}{8}-\frac {i}{8}\right ) ((4+i) A+(1+2 i) B) \log \left (\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2} a d}+\frac {((5-3 i) A+(3+i) B) \log \left (\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{8 \sqrt {2} a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 267, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 9, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3596, 3529, 3534, 1168, 1162, 617, 204, 1165, 628} \[ \frac {((5+3 i) A-(3-i) B) \tan ^{-1}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{4 \sqrt {2} a d}+\frac {((3-i) B-(5+3 i) A) \tan ^{-1}\left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{4 \sqrt {2} a d}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}-\frac {\left (\frac {1}{8}-\frac {i}{8}\right ) ((4+i) A+(1+2 i) B) \log \left (\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2} a d}+\frac {((5-3 i) A+(3+i) B) \log \left (\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{8 \sqrt {2} a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 617
Rule 628
Rule 1162
Rule 1165
Rule 1168
Rule 3529
Rule 3534
Rule 3596
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))} \, dx &=\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}+\frac {\int \frac {\frac {1}{2} a (5 A+i B)-\frac {3}{2} a (i A-B) \tan (c+d x)}{\tan ^{\frac {3}{2}}(c+d x)} \, dx}{2 a^2}\\ &=-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}+\frac {\int \frac {-\frac {3}{2} a (i A-B)-\frac {1}{2} a (5 A+i B) \tan (c+d x)}{\sqrt {\tan (c+d x)}} \, dx}{2 a^2}\\ &=-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}+\frac {\operatorname {Subst}\left (\int \frac {-\frac {3}{2} a (i A-B)-\frac {1}{2} a (5 A+i B) x^2}{1+x^4} \, dx,x,\sqrt {\tan (c+d x)}\right )}{a^2 d}\\ &=-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}-\frac {((5+3 i) A-(3-i) B) \operatorname {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {\tan (c+d x)}\right )}{4 a d}+\frac {((5-3 i) A+(3+i) B) \operatorname {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {\tan (c+d x)}\right )}{4 a d}\\ &=-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}-\frac {((5+3 i) A-(3-i) B) \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{8 a d}-\frac {((5+3 i) A-(3-i) B) \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{8 a d}-\frac {((5-3 i) A+(3+i) B) \operatorname {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{8 \sqrt {2} a d}-\frac {((5-3 i) A+(3+i) B) \operatorname {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{8 \sqrt {2} a d}\\ &=-\frac {((5-3 i) A+(3+i) B) \log \left (1-\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{8 \sqrt {2} a d}+\frac {((5-3 i) A+(3+i) B) \log \left (1+\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{8 \sqrt {2} a d}-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}-\frac {((5+3 i) A-(3-i) B) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{4 \sqrt {2} a d}+\frac {((5+3 i) A-(3-i) B) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{4 \sqrt {2} a d}\\ &=\frac {((5+3 i) A-(3-i) B) \tan ^{-1}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{4 \sqrt {2} a d}-\frac {((5+3 i) A-(3-i) B) \tan ^{-1}\left (1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{4 \sqrt {2} a d}-\frac {((5-3 i) A+(3+i) B) \log \left (1-\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{8 \sqrt {2} a d}+\frac {((5-3 i) A+(3+i) B) \log \left (1+\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )}{8 \sqrt {2} a d}-\frac {5 A+i B}{2 a d \sqrt {\tan (c+d x)}}+\frac {A+i B}{2 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.44, size = 217, normalized size = 0.81 \[ \frac {(\cos (d x)+i \sin (d x)) (A+B \tan (c+d x)) \left ((-4 \cos (d x)+4 i \sin (d x)) (4 A \cos (c+d x)+(-B+5 i A) \sin (c+d x))+(-\sin (c)+i \cos (c)) \sqrt {\sin (2 (c+d x))} \sec (c+d x) \left (((3-5 i) A+(1+3 i) B) \sin ^{-1}(\cos (c+d x)-\sin (c+d x))-(1+i) ((4+i) A+(1+2 i) B) \log \left (\sin (c+d x)+\sqrt {\sin (2 (c+d x))}+\cos (c+d x)\right )\right )\right )}{8 d \sqrt {\tan (c+d x)} (a+i a \tan (c+d x)) (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.75, size = 703, normalized size = 2.63 \[ \frac {{\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} - a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{2} d^{2}}} \log \left (\frac {2 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{2} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) - {\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} - a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{2} d^{2}}} \log \left (-\frac {2 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{2} d^{2}}} - {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) + 2 \, {\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} - a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \sqrt {\frac {-4 i \, A^{2} + 4 \, A B + i \, B^{2}}{a^{2} d^{2}}} \log \left (\frac {{\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-4 i \, A^{2} + 4 \, A B + i \, B^{2}}{a^{2} d^{2}}} + 2 \, A + i \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{a d}\right ) - 2 \, {\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} - a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \sqrt {\frac {-4 i \, A^{2} + 4 \, A B + i \, B^{2}}{a^{2} d^{2}}} \log \left (-\frac {{\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-4 i \, A^{2} + 4 \, A B + i \, B^{2}}{a^{2} d^{2}}} - 2 \, A - i \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{a d}\right ) + 2 \, {\left ({\left (-9 i \, A + B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 8 i \, A e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A - B\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{8 \, {\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} - a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {B \tan \left (d x + c\right ) + A}{{\left (i \, a \tan \left (d x + c\right ) + a\right )} \tan \left (d x + c\right )^{\frac {3}{2}}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.36, size = 254, normalized size = 0.95 \[ -\frac {\arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}+i \sqrt {2}}\right ) A}{d a \left (\sqrt {2}+i \sqrt {2}\right )}+\frac {i \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}+i \sqrt {2}}\right ) B}{d a \left (\sqrt {2}+i \sqrt {2}\right )}-\frac {2 A}{a d \sqrt {\tan \left (d x +c \right )}}-\frac {\left (\sqrt {\tan }\left (d x +c \right )\right ) A}{2 d a \left (\tan \left (d x +c \right )-i\right )}-\frac {i \left (\sqrt {\tan }\left (d x +c \right )\right ) B}{2 d a \left (\tan \left (d x +c \right )-i\right )}-\frac {2 i \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}-i \sqrt {2}}\right ) B}{d a \left (\sqrt {2}-i \sqrt {2}\right )}-\frac {4 \arctan \left (\frac {2 \left (\sqrt {\tan }\left (d x +c \right )\right )}{\sqrt {2}-i \sqrt {2}}\right ) A}{d a \left (\sqrt {2}-i \sqrt {2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.37, size = 266, normalized size = 1.00 \[ 2\,\mathrm {atanh}\left (\frac {a\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {-\frac {A^2\,1{}\mathrm {i}}{a^2\,d^2}}}{A}\right )\,\sqrt {-\frac {A^2\,1{}\mathrm {i}}{a^2\,d^2}}+2\,\mathrm {atanh}\left (\frac {4\,a\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {\frac {A^2\,1{}\mathrm {i}}{16\,a^2\,d^2}}}{A}\right )\,\sqrt {\frac {A^2\,1{}\mathrm {i}}{16\,a^2\,d^2}}-\mathrm {atan}\left (\frac {2\,a\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {\frac {B^2\,1{}\mathrm {i}}{4\,a^2\,d^2}}}{B}\right )\,\sqrt {\frac {B^2\,1{}\mathrm {i}}{4\,a^2\,d^2}}\,2{}\mathrm {i}+\mathrm {atan}\left (\frac {4\,a\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {-\frac {B^2\,1{}\mathrm {i}}{16\,a^2\,d^2}}}{B}\right )\,\sqrt {-\frac {B^2\,1{}\mathrm {i}}{16\,a^2\,d^2}}\,2{}\mathrm {i}-\frac {\frac {2\,A}{a\,d}+\frac {A\,\mathrm {tan}\left (c+d\,x\right )\,5{}\mathrm {i}}{2\,a\,d}}{\sqrt {\mathrm {tan}\left (c+d\,x\right )}+{\mathrm {tan}\left (c+d\,x\right )}^{3/2}\,1{}\mathrm {i}}+\frac {B\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{2\,a\,d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________